package com.xframe.domain.e3sp.bu.sale;

import com.xframe.domain.BaseModel;
import com.xframe.xdal.core.annotation.AutoFill;
import com.xframe.xdal.core.annotation.XColumn;
import com.xframe.xdal.core.annotation.XHasMany;
import com.xframe.xdal.core.annotation.XTable;
import com.xframe.xdal.core.constant.AutoFillType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * com.xframe.domain.e3sp.bu.sale.SaleRet
 * @author zjj
 * @create 2024/4/23 9:47
 */

@Data
@Accessors(chain=true)
@XTable(value = "bu_t01_sale_ret", label = "销退单",dataSourceCode = "warehouse")
@XHasMany(typeName = "com.xframe.domain.e3sp.bu.sale.SaleRetDetail",foreignKey = "saleRetId", targetKey = "saleRetId",as = "detailList")
public class SaleRet extends BaseModel {

    /**
     * 销退单ID
     */
    @AutoFill(AutoFillType.Snowflake)
    @XColumn(name = "sale_ret_id", primaryKeyFlag = true,desc = "销退单ID")
    private Long saleRetId;

    /**
     * 国内订单ID
     */
    @XColumn(name = "order_id", desc = "国内订单ID")
    private Long orderId;

    /**
     * 销退单号
     */
    @XColumn(name = "sale_ret_no", desc = "销退单号")
    private String saleRetNo;

    /**
     * 订单号
     */
    @XColumn(name = "order_no", desc = "订单/出库单")
    private String orderNo;

    /**
     * 创建来源 1 = 手工创建 2 = 仓库系统创建
     */
    @XColumn(name = "create_source", desc = "创建来源")
    private Integer createSource;

    /**
     * 状态 1 = 已申请  2 = 已确认
     */
    @XColumn(name = "status", desc = "状态")
    private String status;

    /**
     * 销退单明细
     */
    private List<SaleRetDetail> detailList;
}
